Page({
  data: {
    Scaned: '扫描二维码',
  },
  onLoad: function (res) {
    this.setData({
      Scaned: res.str
    })
  },
  Scan: function () {
    let that = this
    wx.scanCode({
      onlyFromCamera: true,
      scanType: 'qrCode',
      success: (res) => {
        // 成功扫码
        console.log('扫码结果：', res)
        that.setData({
          Scaned: res.result
        })
        wx.showToast({
          title: "扫码成功！",
          duration: 3000
        })
      }
    })
  },
  Close:function(){
    wx.navigateBack({
    })
  }
})
